package com.demo2do.fms.queue.dao;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.demo2do.fms.entity.vehicle.ModifiedStatus;
import com.demo2do.fms.entity.vehicle.trailer.TrailerModifiedVersion;

/**
 *
 * @author Ark
 *
 */
@Dao("hibernate")
public interface TrailerModifiedVersionDao {

    /**
     * @param trailerId
     * @param status
     * @return
     */
    @Query("FROM TrailerModifiedVersion WHERE disabled = false AND trailerId = :trailerId AND status = :status ORDER BY versionSorting DESC")
    public TrailerModifiedVersion load(@Variable("trailerId") Long trailerId, @Variable("status") ModifiedStatus status);
    
}
